package com.logica.mdm.webfrontend.embedding.resolver;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.logica.mdm.webfrontend.embedding.EmbeddingAdapter;

/**
 * Implementation of EmbeddingResolver that simply uses a fixed adapter.
 * The fixed adapter can be defined via the "defaultEmbeddingAdapter" property.
 * @author Fabien Crespel <fabien.crespel@logica.com>
 */
public class FixedEmbeddingResolver extends AbstractEmbeddingResolver {

	@Override
	public EmbeddingAdapter resolveEmbeddingAdapter(HttpServletRequest request) {
		return getDefaultEmbeddingAdapter();
	}

	@Override
	public void setEmbeddingAdapter(HttpServletRequest request, HttpServletResponse response, EmbeddingAdapter embeddingAdapter) {
		throw new UnsupportedOperationException("Cannot change embedding adapter - use a different embedding resolution strategy");
	}

}
